#include "StdAfx.h"
#include "StopWords.h"
#include <fstream>

StopWords::StopWords()
{
}

void StopWords::AddFile(char* filename)
{
	std::ifstream file;
	file.open(filename);

	while(file.good())
	{
		std::string word;
		getline(file, word);
		WordMap::iterator it = m_StopWords.find(word);
		if(it == m_StopWords.end())
			m_StopWords.insert(WordMap::value_type(word, 0));
	}
}

bool StopWords::IsStopWord(std::string& word)
{
	WordMap::iterator it = m_StopWords.find(word);
	if(it == m_StopWords.end())
		return false;

	return true;
}